package me.android.library.utils.android;

import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.AppOpsManager;
import android.app.NotificationManager;
import android.app.usage.UsageStatsManager;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.content.res.AssetManager;
import android.hardware.usb.UsbManager;
import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
import android.net.wifi.p2p.WifiP2pManager;
import android.os.PowerManager;
import android.os.storage.StorageManager;
import android.telephony.TelephonyManager;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;

import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;


@Slf4j
@UtilityClass
public class SystemServiceUtil {

    public AssetManager getAssetManager() {
        return ContextUtil.getAppContext().getAssets();
    }

    public ActivityManager getActivityManager() {
        return (ActivityManager) ContextUtil.getAppContext().getSystemService(Context.ACTIVITY_SERVICE);
    }

    public ConnectivityManager getConnectivityManager() {
        return (ConnectivityManager) ContextUtil.getAppContext().getSystemService(Context.CONNECTIVITY_SERVICE);
    }

    public WifiManager getWifiManager() {
        return (WifiManager) ContextUtil.getAppContext().getSystemService(Context.WIFI_SERVICE);
    }

    public WifiP2pManager getWifiP2pManager() {
        return (WifiP2pManager) ContextUtil.getAppContext().getSystemService(Context.WIFI_P2P_SERVICE);
    }

    public NotificationManager getNotificationManager() {
        return (NotificationManager) ContextUtil.getAppContext().getSystemService(Context.NOTIFICATION_SERVICE);
    }

    public InputMethodManager getInputMethodManager() {
        return (InputMethodManager) ContextUtil.getAppContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    }

    public TelephonyManager getTelephonyManager() {
        return (TelephonyManager) ContextUtil.getAppContext().getSystemService(Context.TELEPHONY_SERVICE);
    }

    public AlarmManager getAlarmManager() {
        return (AlarmManager) ContextUtil.getAppContext().getSystemService(Context.ALARM_SERVICE);
    }

    public AppOpsManager getAppOpsManager() {
        return (AppOpsManager) ContextUtil.getAppContext().getSystemService(Context.APP_OPS_SERVICE);
    }

    public UsageStatsManager getUsageStatsManager() {
        return (UsageStatsManager) ContextUtil.getAppContext().getSystemService(Context.USAGE_STATS_SERVICE);
    }

    public WindowManager getWindowManager() {
        return (WindowManager) ContextUtil.getAppContext().getSystemService(Context.WINDOW_SERVICE);
    }

    public PowerManager getPowerManager() {
        return (PowerManager) ContextUtil.getAppContext().getSystemService(Context.POWER_SERVICE);
    }

    public StorageManager getStorageManager() {
        return (StorageManager) ContextUtil.getAppContext().getSystemService(Context.STORAGE_SERVICE);
    }

    public UsbManager getUsbManager(){
        return  (UsbManager) ContextUtil.getAppContext().getSystemService(Context.USB_SERVICE);
    }

    public BluetoothManager getBluetoothManager(){
        return  (BluetoothManager) ContextUtil.getAppContext().getSystemService(Context.BLUETOOTH_SERVICE);
    }



}
